<?php
require_once "../class/fenajax.class.php";

include "../dyn/connexion.php";

$f = newFen(__FILE__,"Espace Administrateur",4);

$f->displayHeader();

echo "
<script type=\"text/javascript\">
	menuAccordion();
	init_admin();
	init_atelier();
	init_texte();
	init_actu();
	afficher_cacher();
	dialogueAnimeActu();
	desinsc_atelier();
	$(window).load(function() {
		$('#featured').orbit();
	});
</script>
";

echo "<div class=\"center\">
	".BMInfo("Note: Gerer votre compte et ceux des utilisateurs à partir de cet espace",false)."<br /><br /><br />
	</div>
";

$f->displayActu();

$f->displayOrbit();

echo "
<div id=\"accordion\">
		
	<div class=\"group\">
		<h3>Les Demandes</h3>
		<div class=\"center\"><br />
	";
			
			$compt = 0;
			$res = mysql_query("SELECT * FROM Utilisateur WHERE  statut = 0 ;");
			while($row = mysql_fetch_array($res)) {
				$compt += 1;
			}
	
			$res = mysql_query("SELECT * FROM Texte WHERE  statut = 0 ;");
			while($row = mysql_fetch_array($res)) {
				$compt += 1;
			}
		
			$res = mysql_query("SELECT * FROM Commentaire WHERE  statut = 0 ;");
			while($row = mysql_fetch_array($res)) {
				$compt += 1;
			}
		
		
			if ($compt != 0) {
				if ($compt == 1) {
					$demande = "demande";
					$la_les_demande = "Valider la demande";
				}
				else {
					$demande = "demandes";
					$la_les_demande = "Valider les demandes";
				}
				echo "<div>";
				echo "".BMInfo("Note: ".$compt." ".$demande." en attente",false)."";
				echo "</div><br />";
			
				echo "<a href=\"admin_validation.php\" class=\"ui-state-default ui-corner-all button\" id=\"newValid\"><img src=\"../images/valider.png\" />".$la_les_demande."</a><br /><br /><br /><br />
				";
			}
			else {
				echo "".BMInfo("Note: Aucune demande en attente",false)."<br /><br /><br /><br /><br /><br />";
			}
			
	echo "	
		</div>
	</div>";
	
	
	echo "
	<div class=\"group\">
		<h3>Les Actualités</h3>
		<div class=\"center\"><br />
			
			<a href=\"#\" class=\"ui-state-default ui-corner-all button\" id=\"newActu\"><img src=\"../images/ajouter.png\" />Ajouter</a>
			<a href=\"#\" class=\"ui-state-default ui-corner-all button\" id=\"suppActu\"><img src=\"../images/supprimer.png\" />Supprimer</a>

			
		</div>
	</div>
	";
	
	echo "
	<div class=\"group\">
		<h3>Les Ateliers</h3>
		<div class=\"center\"><br />
			
			<a href=\"#\" class=\"ui-state-default ui-corner-all button\" id=\"newAtelier\"><img src=\"../images/ajouter.png\" />Créer</a>
			<a href=\"admin_atelier.php\" class=\"ui-state-default ui-corner-all button\" id=\"modifAtelier\"><img src=\"../images/modifier.png\" />Modifier</a>
			<a href=\"#\" class=\"ui-state-default ui-corner-all button\" id=\"supAtelier\"><img src=\"../images/supprimer.png\" />Supprimer</a>
			<br /><br />
			<a href=\"user_atelier.php\" class=\"ui-state-default ui-corner-all button\" id=\"adhInscAtelier\"><img src=\"../images/ajouter.png\" />M'inscrire</a>
			<a href=\"#\" class=\"ui-state-default ui-corner-all button\" id=\"adhDesinscAtelier\"><img src=\"../images/supprimer.png\" />Me désinscrire</a>
			
			
			
		</div>
	</div>
	";
	
	echo "
	<div class=\"group\">
		<h3>Mon Compte</h3>
		<div class=\"center\"><br />

			<a href=\"#\" class=\"ui-state-default ui-corner-all button\" id=\"newMdp\"><img src=\"../images/modifier.png\" />Modifier mon mot de passe</a>
			<a href=\"#\" class=\"ui-state-default ui-corner-all button\" id=\"newInfo\"><img src=\"../images/modifier.png\" />Modifier mes informations</a>		
			
			
		</div>
	</div>
	";
	
	echo "
	<div class=\"group\">
		<h3>Les Utilisateurs</h3>
		<div class=\"center\"><br />
			
			
			<a href=\"#\" class=\"ui-state-default ui-corner-all button\" id=\"newAjou\"><img src=\"../images/ajouter.png\" />Ajouter</a>
			<a href=\"admin_users.php\" class=\"ui-state-default ui-corner-all button\" id=\"Modif\"><img src=\"../images/modifier.png\" />Modifier</a>
			<a href=\"#\" class=\"ui-state-default ui-corner-all button\" id=\"newSupp\"><img src=\"../images/supprimer.png\" />Supprimer</a>
			
			
			
		</div>
	</div>
	";
	
	echo "
	<div class=\"group\">
		<h3>Les Textes</h3>
		<div class=\"center\"><br />
			
			
			<a href=\"admin_texte.php\" class=\"ui-state-default ui-corner-all button\" id=\"modifTexte\"><img src=\"../images/modifier.png\" />Modifier</a>
			<a href=\"#\" class=\"ui-state-default ui-corner-all button\" id=\"suppTexte\"><img src=\"../images/supprimer.png\" />Supprimer</a>
			
			
			
		</div>
	</div>
	";


echo "
</div>
";


$f->displayFooter();	
?>